import axios from "~/axios";
//损耗
export function getSpoilage(page) {
  return axios.get("/spoilage?page=" + page);
}

export function createSpoilage(data) {
  return axios.post("/spoilage", data);
}

export function updateSpoilage(id, data) {
  return axios.put(`/spoilage/${id}`, data);
}

export function deleteSpoilage(id) {
  return axios.delete(`/spoilage/${id}`);
}

//采购

export function getPurchase(page) {
  return axios.get("/purchase?page=" + page);
}

export function createPurchase(data) {
  return axios.post("/purchase", data);
}

export function updatePurchase(id, data) {
  return axios.put(`/purchase/${id}`, data);
}

export function deletePurchase(id) {
  return axios.delete(`/purchase/${id}`);
}
